package com.z6pin.coin.controller;


import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.z6pin.coin.domain.Person;

@RestController
public class PersonController {
    
    @RequestMapping(value = "/save", method = RequestMethod.POST)
    public List<Person> save(@RequestBody String  personName) {
	    	Person p = new Person(personName);
	    	List<Person> people = new ArrayList<Person>();
        return people;
    }

    @RequestMapping(value = "/getDjg", method = RequestMethod.POST)
    public Person getDjg(@RequestBody Person personreq) {
    		System.out.println("person:getDjg:id--"+personreq.getId()+"--name--"+personreq.getName());
    		personreq.setName(personreq.getName()+" from service getDjg");
        return personreq;
    }
    
}
